package cn.com.self.apis.portal.entity;

import cn.com.selfsoft.smartcity.commons.entity.AbstractEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.sql.Timestamp;

/**
 * 通知公告表
 * @author CRL
 * @date 2021/1/9 14:05
 */
@TableName("notice_info")
@Data
public class NoticeEntity extends AbstractEntity {

    @NotNull(message = "标题不能为空")
    @NotBlank(message = "标题不能为空")
    @ApiModelProperty(value = "标题")
    private String title;

    @NotNull(message = "优先级不能为空")
    @NotBlank(message = "优先级不能为空")
    @ApiModelProperty(value = "优先级")
    private String priority;

    @ApiModelProperty(value = "排序")
    private String sort;

    @NotNull(message = "内容不能为空")
    @NotBlank(message = "内容不能为空")
    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "附件url")
    private String fileUrl;

    @ApiModelProperty(value = "跳转链接")
    private String goUrl;

    @ApiModelProperty(value = "上架时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp upTime;

    @ApiModelProperty(value = "下架时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp dowTime;

}
